import { request } from '@umijs/max';

/**
 * 获取角色
 * @returns
 */
export async function get_role_list_api() {
  return request<ResponseApi.ResUnifyFormat<any>>(`/admin/z_role/findRoles`, {
    method: 'GET',
  });
}

/**
 * 获取部门
 * @returns
 */
export async function get_dept_list_api() {
  return request<ResponseApi.ResUnifyFormat<any>>(`/admin/z_dept/findALLDeptTree`, {
    method: 'GET',
  });
}

export async function get_dept_xia_list_api() {
  return request<ResponseApi.ResUnifyFormat<any>>(`/admin/z_dept/findXiaDeptTree`, {
    method: 'GET',
  });
}

/**
 * 获取菜单
 * @returns
 */
export async function get_menu_list_api(ID: string) {
  return request<ResponseApi.ResUnifyFormat<any>>(`/admin/z_user/findRoleMenuTree?id=${ID}`, {
    method: 'GET',
  });
}
/**
 * 获取字典
 * @returns
 */
export async function get_detailedfieldName_list_api(fieldName: string) {
  return request<ResponseApi.ResUnifyFormat<any>>(
    `/admin/z_dictionary_detailed/findNameList?fieldName=${fieldName}`,
    {
      method: 'GET',
    },
  );
}
